<p>
  <b>Receipt:</b>
  <%=h @purchase.receipt.store.company.name.concat(' ').concat(@purchase.receipt.rDate.to_s) %>
</p>

<p>
  <b>Item:</b>
  <%=h @purchase.item.brand.name rescue nil %> <%=h @purchase.item.name %>
</p>

<p>
  <b>Quantity:</b>
  <%=h @purchase.quantity %> <%=h @purchase.item.measure.unit rescue nil %>
</p>

<p>
  <b>Price:</b>
  <%=h number_to_currency(@purchase.price) %>
</p>

<p>
  <b>Unit Price:</b>
  <%=h number_to_currency(@purchase.price/@purchase.quantity) %> / <%=h @purchase.item.measure.unit rescue nil %>
</p>

<p>
  <b>Tax rate:</b>
  <%=h number_to_percentage(@purchase.tax_rate, :precision => 2) %>
</p>

<p>
  <b>Sale:</b>
  <%=h @purchase.sale == true ? "Yes" : "No" %>
</p>

<p>
  <b>Coupon:</b>
  <%=h number_to_currency(@purchase.coupon) %>
</p>

<p>
  <b>Notes:</b>
  <%=h @purchase.notes %>
</p>


<%= link_to 'Edit', edit_purchase_path(@purchase) %> |
<%= link_to 'Back', @purchase.receipt %>
